package functions;

import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.annotation.FunctionHint;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;

@FunctionHint(output = @DataTypeHint("ROW<word STRING>"))
public class Split extends TableFunction<Row> {
    public void eval(String input, String delimiter) {
        String[] split = input.split(delimiter);
        for (String s : split) {
            collect(Row.of(s));
        }
    }
}